package weekMatch.one_349;

import java.util.Arrays;

public class LeeCode_01 {
    public static void main(String[] args) {

    }
    private static int findNonMinOrMax(int[] nums) {
        Arrays.sort(nums);
        int min = nums[0], max = nums[nums.length - 1];
        for (int num : nums) {
            if (num != min && num != max){
                return num;
            }
        }
        return -1;
    }
}